﻿using StudentCouncil.Model.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StudentCouncil.DAL.DAO
{
   public class RenwuDAO
    {
        public static List<Renwu> GetList() {
            using (StudentContext db=new StudentContext()) {
                return db.Renwu.ToList();
            }
        }
        public static bool UpdateRw(Renwu entity)
        {
            using (StudentContext db=new StudentContext()) {
                var dbEntity = db.Renwu.Find(entity.RewuId);
                if (null == dbEntity)
                {
                    //Log4Helper.InfoLog.Warn("未找到该user id：" + entity.ID);
                    return false;
                }
                else
                {
                    dbEntity.Rwthings = entity.Rwthings;
                    db.SaveChanges();
                    return true;
                }
            }
        }
        
    }
}
